package center;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.Transaction;

import entity.Student;
import util.HibernateUtil;

public class StuCenterDaoImpl implements StuCenterDao{

	@Override
	public List<Student> findAll() {
		Session session=HibernateUtil.openSession();
		Transaction trans=null;
		try{
			trans=session.beginTransaction();
			List<Student> list=session.createQuery("from Student").list();
			trans.commit();
			return list;
		}
		catch (RuntimeException e) {
			trans.rollback();
			throw e;
		} finally {
			session.close();
		}
	}

	@Override
	public void updatePwd(String password) {
		Session session=HibernateUtil.openSession();
		trans
		
	}
	
}
